/* 
能对books进行CRUD操作的Model
*/
const mongoose = require('mongoose')

// 定义文档结构 => 生成Schema对象
const bookSchema = mongoose.Schema({
  name: String,
  author: String,
  price: Number
})

// 生成Model
const BookModel = mongoose.model('books', bookSchema)

// 暴露 BookModel
module.exports = BookModel